import zipfile

class AsyncZip:
    def __init__(self, infile, outfile):
        self.infile = infile
        self.outfile = outfile

    def run(self):
        f = zipfile.ZipFile(self.outfile, 'w', zipfile.ZIP_DEFLATED)
        f.write(self.infile)
        f.close()
        #print('Finished background zip of:', self.infile)

#background = AsyncZip('mydata.txt', 'myarchive.zip')
